/*
 * Example2ActionListener.java  0.4.0 / 2010-10-22
 *
 * Copyright (c) 2010 - 2011, cute4j.com and contributors.
 *
 * This software is licensed under the LGPL version 2.1 license.
 * A copy of this license is included in the file LICENSE-LGPL.txt.
 */
package com.cute4j.examples;

import com.cute4j.swing.Button;
import com.cute4j.swing.Swing;
import com.cute4j.swing.events.ActionEvent;
import com.cute4j.swing.events.ActionListener;

/**
 * ActionListener Example.
 */
public class Example2ActionListener {

  public static void main(String[] args) {
    Button button = new Button("Close");
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Swing.stopEventLoop();
      }
    });
    button.setName("Hello World");
    button.setSize(150, 50);
    button.setVisible(true);
    Swing.startEventLoop();
  }

}
